<template>
  <div class="body-main">


    <div class="goodsinformation">
      <div class="information">收货信息</div>
      <div>
        <div class="addressinformation">
          <el-form ref="form" label-width="80px" :model="form" >
            <el-form-item label="所在地区:" size="small">
              <el-select class="selectAddress" v-model="provinceId">
                <el-option
                  v-for="province in form"
                  :key="province.id"
                  :label="province.name"
                  :value="`${province.categoryid1}:${province.name}`"
                ></el-option>
              </el-select>
              <el-select class="selectAddress" v-model="provinceId2">
                <el-option
                  v-for="city in form1.cityname"
                  :key="city.id"
                  :label="city.name"
                  :value="city.id"
                ></el-option>
 </el-select>
            </el-form-item>
            <el-form-item label="详细地址:">
              <el-input
                type="textarea"
                placeholder="详细地址、街道、门牌号等"
              />
            </el-form-item>
            <div>
              <el-form-item label="收货人:" class="consignee">
                <el-input />
              </el-form-item>
              <el-form-item label="手机号码:" class="phonenumber">
                <el-input />
              </el-form-item>
            </div>
          </el-form>

        </div>
        <div class="defaultaddress">
          <div class="confirmationmessage">
            <el-checkbox>默认地址</el-checkbox>
          </div>
          <div>
            <button class="conserveAddress">保存</button>
            <button class="cancelAddress">取消</button>
          </div>
        </div>
      </div>
    </div>
    <!-- 包裹 -->
    <div class="paymentOrder">
      <div class="parcel"><span>包裹1</span></div>
      <div class="m-table">
        <div class="theadBg"></div>
        <table>
          <thead class="hd">
            <tr>
              <td class="f-txtleft" style="width: 360px">商品信息</td>
              <td class="" style="width: 165px">单价</td>
              <td class="" style="width: 171px">数量</td>
              <td class="" style="width: 191px">小计</td>
              <td class="" style="width: 179px">实付</td>
            </tr>
          </thead>
          <tbody class="m-tbody tbody">
            <tr class="tr">
              <td class=".m-itemInfoTd">
                <div class="imgWrap f-left">
                  <img
                    src="https://yanxuan-item.nosdn.127.net/552479eefe329db41b1ac5a29cd69672.png?type=webp&amp;imageView&amp;quality=95&amp;thumbnail=100x100"
                  />
                </div>
                <div class="infoWrap f-txtleft">
                  <div class="infoInnerWrap">
                    <div class="name f-text-overflow">
                      <span title="蛋香源于鲜鸡蛋含量≥40%，港式鸡蛋仔"
                        >蛋香源于鲜鸡蛋含量≥40%，港式鸡蛋仔</span
                      >
                    </div>
                    <p class="line line1 f-text-overflow">
                      <span class="spec" title="港式鸡蛋仔 原味 420克 "
                        >港式鸡蛋仔 原味 420克
                      </span>
                    </p>
                    <div class="servicePolicy11">
                      <span>部分服务不支持</span>
                      <i class="iconfont icon-gantanhaozhong"></i>
                    </div>
                  </div>
                </div>
              </td>
              <td>￥ 69</td>
              <td>1</td>
              <td>69</td>
              <td>69</td>
            </tr>
          </tbody>
        </table>
      </div>
    
    
        <!-- 底 -->
        <div class="row2">
        <div class="row-top">
          <div class="row-left">
            <p>发票信息：<span class="iconfont icon-wenhao"></span></p>
            <p><input type="checkbox" />我要开发票</p>
          </div>
          <div class="row-right">
            <div right-l>
              <p>商品合计 &nbsp;&nbsp;:</p>
              <p>邮费&nbsp;&nbsp;:</p>
              <p>活动优惠<i class="iconfont icon-infofill"></i>&nbsp;&nbsp;:</p>
            </div>
            <div right-r>
              <p>￥79.90</p>
              <p>￥0.00</p>
              <p>-￥10.90</p>
            </div>
          </div>
        </div>
        <div class="row-bom">
          <div class="bom-top">
            <div class="bom-t">
              <span>应付总额 &nbsp;:</span>
              <span>￥69.00</span>
            </div>
            <div class="add">
              <a href="#">去付款</a>
            </div>
          </div>
        </div>
        <div class="bom-t1">
          <div>应付总额</div>
          <div>
            广东省深圳市宝安区航城街道后瑞广东省深圳市宝安区航城街道后瑞
        </div>
        <div class="defaultaddress">
          <div class="confirmationmessage">
            <el-checkbox v-model="checked">默认地址</el-checkbox>
          </div>
          <div>
            <button class="conserveAddress">保存</button>
            <button class="cancelAddress">取消</button>
          </div>
        </div>
      </div>
    </div>
    </div>
  </div>
 
</template>

<script>
import { reqGetProvince, reqGetCity } from "@/api";

export default {
  name: "ConfirmAddress",
  data() {
    return {
      form: [],
      data: {
        provinceName: "",
      },
      form1: [],
      provinceId: undefined,
      provinceId2: undefined,
    };
  },
  mounted() {
    this.getProvince();
  },
  methods: {
    // 获取省份的数据
    async getProvince() {
      this.form = await reqGetProvince();
    },
  },
  watch: {
    provinceId: {
      async handler() {
        this.form1 = await reqGetCity(this.provinceId);
      },
    },
  },
};
</script>

<style lang="less" scoped>
.body-main {

  margin-top: 20px;


  box-sizing: border-box;
}
.goodsinformation {
  width: 1200px;
  margin: 0 auto;
  margin-bottom: 20px;
  height: 400px;
  border: 2px solid #f5f5f5;
}
.goodsinformation .information {
  padding-left: 21px;
  background-color: #f5f5f5;
  line-height: 41px;
  color: #999;
  margin-bottom: 60px;
  border: 2px solid #f5f5f5;
}
.addressinformation {
  width: 750px;
  float: left;
}
.selectAddress {
  margin-right: 20px;
}
.consignee {
  float: left;
}
.phonenumber {
  float: right;
}
.defaultaddress {
  float: right;
  margin-top: 10px;
  margin-left: 40px;
  width: 320px;
  padding: 57px 0 43px 60px;
  border-left: 1px dashed #dedede;
}

.confirmationmessage {
  color: #fff;
  margin-bottom: 10px;
}
.conserveAddress {
  text-align: center;
  width: 144px;
  height: 42px;
  font-size: 16px;
  color: #fff;
  border-radius: 2px;
  border: 1px solid #b4a078;
  background-color: #b4a078;
}
.cancelAddress {
  margin-left: 10px;
  width: 144px;
  height: 42px;
  color: #b4a078;
  border: 1px solid #b4a078;
  background-color: #f5f3ef;
  border-radius: 2px;
}
.paymentOrder {
  width: 1200px;
  margin: 0 auto;
}
.paymentOrder .parcel {
  height: 42px;
  line-height: 40px;
  background: #f8f5f0;
  border: 1px solid #e8e8e8;
  margin: -1px 0;
  padding: 0 15px;
  color: #666;
}

.theadBg {
  position: absolute;
  height: 42px;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  background-color: #f5f5f5;
}
.m-table {
  border: 1px solid #e8e8e8;
  position: relative;
  width: 1200;
  padding: 0 21px;
  background-color: #fff;
}
.m-table > table {
  position: relative;
  z-index: 1;
  text-align: center;
}
table {
  border-collapse: collapse;
  font-size: 14px;
  border-spacing: 0;
  table-layout: fixed;
  border-color: grey;
  text-indent: initial;
  display: table;
  text-align: center;
}
.m-table .hd {
  line-height: 41px;
  height: 42px;
  color: #999;
}
.hd tr {
  display: table-row;
  vertical-align: inherit;
  border-color: inherit;
}
td {
  font-size: 14px;
  display: table-cell;
}
.f-txtleft {
  text-align: left !important;
}
.m-table .tbody {

  padding: 20px 0;

    padding: 20px 0;

}
tbody {
  display: table-row-group;
  vertical-align: middle;
  border-color: inherit;
}

// .m-table .tbody .tr {
//   line-height: 1px;
// }

.m-table .tbody .tr {
  line-height: 1px;
}

td {
  display: table-cell;
}

.m-itemInfoTd:after {
  clear: both;
  content: " ";
  display: table;
}
.m-itemInfoTd .imgWrap {
  position: relative;
}
.f-left {
  float: left;
}
.m-itemInfoTd .imgWrap img {
  width: 100px;
  height: 100px;
  background-color: #f4f4f4;
  vertical-align: top;
}

.m-itemInfoTd .infoWrap {
  position: relative;
  margin-left: 100px;
  height: 100px;
  padding: 2px 0 0 10px;
  pointer-events: none;
}
.m-itemInfoTd .infoWrap .infoInnerWrap {
  pointer-events: auto;
}
.m-itemInfoTd .infoWrap .name {
  line-height: 24px;
}
.f-text-overflow {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.line.line1 span {
  font-size: 12px;
  color: #999999;
}

.m-itemInfoTd .infoWrap .line.line1 {
  line-height: 22px;
  font-size: 12px;
  color: #999;
}
.m-itemInfoTd .infoWrap .line {
  max-width: 248px;
  overflow: hidden;
}
p {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
}

// .m-itemInfoTd .infoWrap .servicePolicy {
//   bottom: 35px;
// }
.servicePolicy11 span {
  // position: absolute;
  // bottom: 5px;
  color: #d52b33 !important;
  // line-height: 1;
  cursor: pointer;
}
.servicePolicy11 i {
  font-size: 20px;
  color: #d52b33 !important;
  // line-height: 1;
  cursor: pointer;
}
// span {
//   color: #333333;
//   font-size: 14px;
//   display: inline-block;
//   margin-left: 13px;
// }

// 底
.row-top {
  overflow: hidden;
}

.row2 {
  /* display: flex; */
  // width: 1200px;
  background-color: #f5f5f5;
  overflow: hidden;
}

.row-left {
  float: left;
  padding: 20px 50px;
}

.row-left p {
  font-size: 14px;
  height: 30px;
}

.row-right {
  display: flex;
  float: right;

  padding-top: 20px;
  padding-right: 50px;
  padding-bottom: 100px;
  padding-left: 50px;
}
.row-right p {
  font-size: 14px;
  margin-left: 80px;
}

.bom-top {
  float: right;
}

.bom-t {
  padding: 20px 50px;
  border-top: 1px dotted #e8e8e8;
}

.bom-t1 {
  margin-top: 130px;
  padding: 20px 0px;
  // margin-left: 50px;
}
.bom-t1 div {
  // padding: 0 50px;
  margin-right: 50px;
  text-align: right;
}

.bom-t span:nth-child(1) {
  margin-right: 20px;
}

.bom-t span:nth-child(2) {
  font-weight: 700;
  color: #d4282d;
  font-size: 20px;
}

.add a {
  background-color: #b4a078;
  margin-top: 15px;
  // margin-left: 10px;
  margin-left: 60px;
  padding: 0 25px;
  font-size: 18px;
  color: white;
  text-align: center;
  width: 130px;
  height: 45px;
  line-height: 45px;
  display: block;
  border: 1px solid #b4a078;
}
.m-itemInfoTd .infoWrap .servicePolicy {
    bottom: 35px;
}
.servicePolicy {
    position: absolute;
    bottom: 5px;
    color: #D52B33 !important;
    line-height: 1;
    cursor: pointer;
}
span{
  color: #333333;
    font-size: 14px;
    display: inline-block;
    margin-left: 13px;

}
</style>
